package com.tensquare.tset;


import com.tensquarte.mq.MqApplication;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

@RunWith(SpringRunner.class)
@SpringBootTest(classes = MqApplication.class)
public class test {

    @Autowired
    private RabbitTemplate rabbitTemplate;

    @Test
    public void sendmessage(){
        rabbitTemplate.convertAndSend("itcast","直接模式");

    }


    //主题模式
    @Test
    public void sendmessage3(){
        rabbitTemplate.convertAndSend("topic","good.log","分裂模式测试");

    }


}
